/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
*/

package com.jinhe.tss.core.cachepool;


/** 
 * <p> DefaultCacheableKey.java </p> 
 * 默认缓存项目的key实体。
 * 包含两个属性key和remark。
 * 
 * @author Jon.King 2006-12-31
 */
public abstract class AbstractCacheableKey implements CacheableKey{

    public boolean equals(Object obj){
        if(!(obj instanceof CacheableKey))
            return false;
        
        CacheableKey key = (CacheableKey) obj;
        return getKey().equals(key.getKey());
    }
    
    public int hashCode(){
        return getKey().hashCode();
    }
    
    public String toString(){
        return getRemark() == null ? "" : getRemark();
    }
}

